package com.gf.forcesystem.scene;

import com.gf.forcesystem.api.WeatherManager;
import com.gf.forcesystem.model.dto.weather.AbstractWeather;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author gaofei
 * @date 2022/6/20 22:11
 * 场景管理
 */
@Component
public class SceneManager implements WeatherManager {
    private final SceneInfo sceneInfo = new SceneInfo();

    public SceneInfo getSceneInfo() {
        return sceneInfo;
    }

    @Override
    public List<AbstractWeather> getWeathers() {
        return sceneInfo.weatherList();
    }

    @Override
    public void deal(AbstractWeather weather) {
        sceneInfo.setWeather(weather.getClass(), weather);
    }
}
